Skip to content

Handle case where alma user lookup returns a 400#39

Merged
davezuckerman merged 2 commits intomainfrom
AP-611-404
Mar 25, 2026
Merged

Handle case where alma user lookup returns a 400#39
davezuckerman merged 2 commits intomainfrom
AP-611-404

Conversation

@davezuckerman
Copy link
Contributor

@davezuckerman davezuckerman commented Mar 24, 2026

Alma patron lookup can also return a 400. Handling that case as well. I'm not sure if we should generalize it more though or if this is o.k. for now? Should we handle the 400 case differently since it could be unrelated to a patron not being found?

@awilfox
Copy link
Member

awilfox commented Mar 24, 2026

Do we know why Alma is returning a 400? Is it a bad request before the request is nil or empty? perhaps we should be handling this further upstream (so that a bad request is not made to Alma).

@davezuckerman
Copy link
Contributor Author

Do we know why Alma is returning a 400? Is it a bad request before the request is nil or empty? perhaps we should be handling this further upstream (so that a bad request is not made to Alma).

It looks like the user wasn't found and it returned a 400 for some reason.

"content-type"=>"application/json;charset=UTF-8", "content-length"=>"180", "date"=>"Wed, 25 Mar 2026 00:29:07 GMT", "connection"=>"close", "server"=>"Layer7-API-Gateway"} @status=400 @reason_phrase="" @response_body="{"errorsExist":true,"errorList":{"error":[{"errorCode":"401861","errorMessage":"User with identifier 12010984 was not found.","trackingId":"E01-2503002908-YUK1D-AWAE1514299096"}]}}">>

having Error::AlmaRecordNotFoundError only return res.status
Copy link
Member

@awilfox awilfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ Looks good to me.

(What a bizarre API, though.)

@davezuckerman davezuckerman merged commit 67a686e into main Mar 25, 2026
5 checks passed
@davezuckerman davezuckerman deleted the AP-611-404 branch March 25, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants